# -*- coding: utf-8 -*-
"""
-------------------------------------------------
   File Name：     day157_pyqt5_qSplitter
   Description :
   Author :       fuml
   date：          2019/9/23
-------------------------------------------------
   Change Activity:
                   2019/9/23:This example shows
how to use QSplitter widget.
-------------------------------------------------
"""
import  sys
from PyQt5.QtWidgets import QWidget,QFrame,QSplitter,QStyleFactory,\
        QHBoxLayout,QApplication
from PyQt5.QtCore import Qt,QMimeData

class Example(QWidget):
    def __init__(self):
        super().__init__()
        self.initUI()

    def initUI(self):
        hbox =QHBoxLayout(self)

        topleftFrame = QFrame(self)
        topleftFrame.setFrameShape(QFrame.StyledPanel)

        toprightFrame = QFrame(self)
        toprightFrame.setFrameShape(QFrame.StyledPanel)

        bottomFrame = QFrame(self)
        bottomFrame.setFrameShape(QFrame.StyledPanel)

        splitter1 = QSplitter(Qt.Horizontal)
        splitter1.addWidget(topleftFrame)
        splitter1.addWidget(toprightFrame)

        splitter2 = QSplitter(Qt.Vertical)
        splitter2.addWidget(splitter1)
        splitter2.addWidget(bottomFrame)

        hbox.addWidget(splitter2)
        # hbox.addWidget(splitter1)

        self.setLayout(hbox)

        self.setGeometry(300, 300, 300, 200)
        self.setWindowTitle('QSplitter')
        self.show()

if __name__ == '__main__':
    app = QApplication(sys.argv)
    ex = Example()
    sys.exit(app.exec_())